package anthology.daily_question._24_12;

import java.util.HashMap;
import java.util.Map;

//https://leetcode.cn/problems/split-the-array/description/?envType=daily-question&envId=2024-12-28
public class _3046分割数组 {
    class Solution {
        public boolean isPossibleToSplit(int[] nums) {
            Map<Integer, Integer> count = new HashMap<>();
            for (int num : nums) {
                count.put(num, count.getOrDefault(num, 0) + 1);
                if (count.get(num) > 2) {
                    return false;
                }
            }
            return true;
        }
    }
}
